<!DOCTYPE HTML>
<html lang="zh-hans" >
    <!-- Start book Python基础 -->
<!-- Start book Python基础 -->
    <head>
        <!-- head:start -->
<!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>交互式编程 | Python基础</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        <meta name="author" content="姜伟">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="gitbook/style.css">
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-prism/prism.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="chapter08.html" />
    
    
    <link rel="prev" href="chapter06.html" />
    

        <!-- head:end -->
<!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
<!-- body:start -->
        
    <div class="book"
        data-level="7"
        data-chapter-title="交互式编程"
        data-filepath="chapter07.md"
        data-basepath="."
        data-revision="Mon Feb 03 2020 11:09:50 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="index.html">
                
                        <i class="fa fa-check"></i>
                        
                        学习目标
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="chapter01.html">
            
                
                    <a href="chapter01.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        计算机组成
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2" data-path="chapter02.html">
            
                
                    <a href="chapter02.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        什么是编程语言
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3" data-path="chapter03.html">
            
                
                    <a href="chapter03.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        Python语言介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4" data-path="chapter04.html">
            
                
                    <a href="chapter04.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        安装配置Python
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5" data-path="chapter05.html">
            
                
                    <a href="chapter05.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        开发工具介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6" data-path="chapter06.html">
            
                
                    <a href="chapter06.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        Pycharm的基本使用
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="7" data-path="chapter07.html">
            
                
                    <a href="./chapter07.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        交互式编程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8" data-path="chapter08.html">
            
                
                    <a href="chapter08.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        注释的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9" data-path="chapter09.html">
            
                
                    <a href="chapter09.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        变量及数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10" data-path="chapter10.html">
            
                
                    <a href="chapter10.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.</b>
                        
                        标识符和关键字
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11" data-path="chapter11.html">
            
                
                    <a href="chapter11.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.</b>
                        
                        输出语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="12" data-path="chapter12.html">
            
                
                    <a href="chapter12.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>12.</b>
                        
                        输入语句
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本书使用 GitBook 发布
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="" >Python基础</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;">&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;</h1>
<p>&#x7B80;&#x5355;&#x8BF4;&#x6765;&#xFF0C;&#x5C31;&#x662F;&#x76F4;&#x63A5;&#x5728;&#x7EC8;&#x7AEF;&#x4E2D;&#x8FD0;&#x884C;&#x89E3;&#x91CA;&#x5668;&#xFF0C;&#x800C;&#x4E0D;&#x4F7F;&#x7528;&#x6587;&#x4EF6;&#x540D;&#x7684;&#x65B9;&#x5F0F;&#x6765;&#x6267;&#x884C;&#x6587;&#x4EF6;&#x3002;&#x8FD9;&#x79CD;&#x4EA4;&#x4E92;&#x5F0F;&#x7684;&#x7F16;&#x7A0B;&#x73AF;&#x5883;&#xFF0C;&#x6211;&#x4EEC;&#x4E5F;&#x53EF;&#x4EE5;&#x79F0;&#x4E4B;&#x4E3A;REPL,&#x5373;&#x8BFB;&#x53D6;(Read)&#x8F93;&#x5165;&#x7684;&#x5185;&#x5BB9;&#xFF0C;&#x6267;&#x884C;(Eval)&#x7528;&#x6237;&#x8F93;&#x5165;&#x7684;&#x6307;&#x4EE4;&#xFF0C;&#x6253;&#x5370;(Print)&#x6267;&#x884C;&#x7ED3;&#x679C;,&#x7136;&#x540E;&#x8FDB;&#x884C;&#x5FAA;&#x73AF;(Loop)&#xFF0C;Python&#x652F;&#x6301;&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;&#x3002;</p>
<h2 id="&#x4E00;&#x3001;python&#x7684;&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;">&#x4E00;&#x3001;Python&#x7684;&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;</h2>
<p><img src="imgs/&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;1.png" alt=""></p>
<h2 id="&#x4E8C;&#x3001;pycharm&#x91CC;&#x8FDB;&#x5165;&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;">&#x4E8C;&#x3001;Pycharm&#x91CC;&#x8FDB;&#x5165;&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;</h2>
<p><img src="imgs/&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;2.png" alt=""></p>
<h1 id="&#x4E09;&#x3001;ipython&#x7684;&#x5B89;&#x88C5;&#x548C;&#x4F7F;&#x7528;">&#x4E09;&#x3001;IPython&#x7684;&#x5B89;&#x88C5;&#x548C;&#x4F7F;&#x7528;</h1>
<p>pyton&#x81EA;&#x5E26;&#x7684;&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;&#xFF0C;&#x529F;&#x80FD;&#x4E0D;&#x591F;&#x5F3A;&#x5927;&#xFF0C;&#x4F8B;&#x5982;&#xFF0C;&#x4E0D;&#x80FD;&#x5B9E;&#x73B0;&#x8BED;&#x6CD5;&#x9AD8;&#x4EAE;&#xFF0C;&#x81EA;&#x52A8;&#x6362;&#x884C;&#x7B49;&#x529F;&#x80FD;&#x3002;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x7B2C;&#x4E09;&#x65B9;&#x7684;&#x5305;IPython(Interactive Python)&#xFF0C;&#x6765;&#x5BF9;&#x81EA;&#x5E26;&#x7684;Python shell&#x8FDB;&#x884C;&#x529F;&#x80FD;&#x6269;&#x5C55;&#x3002;</p>
<h2 id="&#x5B89;&#x88C5;ipython">&#x5B89;&#x88C5;IPython</h2>
<p>&#x4F7F;&#x7528;pip&#x547D;&#x4EE4;&#xFF0C;&#x53EF;&#x4EE5;&#x5FEB;&#x901F;&#x7684;&#x5B89;&#x88C5;IPython.</p>
<pre><code class="lang-shell">pip install ipython
</code></pre>
<h2 id="&#x4F7F;&#x7528;ipython">&#x4F7F;&#x7528;IPython</h2>
<p>&#x5728;&#x547D;&#x4EE4;&#x884C;&#x4E2D;&#x8F93;&#x5165;ipython&#x5373;&#x53EF;&#x8FDB;&#x5165;&#x5230;ipython&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;&#x3002;</p>
<h2 id="&#x5BF9;&#x6BD4;">&#x5BF9;&#x6BD4;</h2>
<p><img src="imgs/IPython&#x7684;&#x4F7F;&#x7528;.png" alt=""></p>
<h1 id="&#x56DB;&#x3001;&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;&#x7684;&#x4F18;&#x7F3A;&#x70B9;">&#x56DB;&#x3001;&#x4EA4;&#x4E92;&#x5F0F;&#x7F16;&#x7A0B;&#x7684;&#x4F18;&#x7F3A;&#x70B9;</h1>
<ul>
<li>&#x4F18;&#x70B9;&#xFF1A;</li>
</ul>
<p>&#x9002;&#x5408;&#x4E8E;&#x5B66;&#x4E60;/&#x9A8C;&#x8BC1; Python &#x8BED;&#x6CD5;&#x6216;&#x8005;&#x5C40;&#x90E8;&#x4EE3;&#x7801;</p>
<ul>
<li>&#x7F3A;&#x70B9;&#xFF1A;<ul>
<li>&#x4EE3;&#x7801;&#x4E0D;&#x80FD;&#x4FDD;&#x5B58;</li>
<li>&#x4E0D;&#x9002;&#x5408;&#x8FD0;&#x884C;&#x592A;&#x5927;&#x7684;&#x7A0B;&#x5E8F;</li>
</ul>
</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="chapter06.html" class="navigation navigation-prev " aria-label="Previous page: Pycharm的基本使用"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="chapter08.html" class="navigation navigation-next " aria-label="Next page: 注释的使用"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="gitbook/app.js"></script>

    
    <script src="gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-copy-code-button/toggle.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"prism":{},"splitter":{},"copy-code-button":{},"toggle-chapters":{},"highlight":{},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
<!-- body:end -->
    </body>
    <!-- End of book Python基础 -->
<!-- End of book Python基础 -->
</html>
